/**
 * Copyright 2008 Hotye Inc.
 */
package craneding.gwt.databean.client.ui.field;

import com.google.gwt.user.client.Element;

import craneding.gwt.databean.client.model.FieldInfo;

/**
 * Field Input Component's interface
 * 
 * @author crane.ding
 * @version 1.0 2008-12-1
 */
public interface IFieldInput {

	/**
	 * get widget's value
	 * 
	 * @return widget's value
	 */
	public Object getValue();

	/**
	 * sets value to widget.
	 * 
	 * @param value
	 *            a value from a bean.
	 */
	public void setValue(Object value);

	/**
	 * sets fieldInfo to fieldInfo's map.
	 * 
	 * @param fieldName
	 *            field's name which is a map key.
	 * @param fieldInfo
	 *            field's info.
	 */
	public void setFieldInfo(String fieldName, FieldInfo fieldInfo);

	/**
	 * Gets a handle to the object's underlying DOM element.
	 * 
	 * @return the object's browser element
	 */
	public Element getElement();

	/**
	 * validity all data
	 * 
	 * @throws ValidationException
	 */
	public void validityCheck() throws ValidationException;
}
